<?php
namespace app\home\model;
use think\Model;
use think\Db;
use think\Session;
class Shortanswer extends model
{
	protected $autoWriteTimestamp = 'datetime';
    protected $error = '';
	protected function initialize()
    {
        //需要调用`Model`的`initialize`方法
        parent::initialize();
        //TODO:自定义的初始化
    }

    /**
     * 返回错误信息
     * $return string
     */
    public function getError(){
        return $this->error;
    }
    /**
     * 返回指定id的信息
     * @param atring $ids
     * $return array
     */
    public function getInfoByIds($ids){
        $data = Db::table('shortanswer')
            ->where('id','in',$ids)
            ->field('id,title,answer,analysis,score')
            ->select();
        return $data;
    }
}
